function [max,min]=gnat_distance(gnat,pt)
 global mplist;
 if(gnat.size<=getMinSize())
  list={};
  for i=1:length(gnat.points)
   list{i}=mplist{gnat.points(i)};
  endfor
  max=max_distance(list,pt);
  min=min_distance(list,pt);
  return;
 endif
 
 max=0;
 min=100000;
 for i=1:length(gnat.subGnats)
  [m1,m2]=gnat_distance(gnat.subGnats{i},pt);
  if(m1>max)
   max=m1;
  endif
  if(m2<min)
   min=m2;
  endif
 endfor
 return;
endfunction

function ret=getMinSize()
 ret=600;
endfunction
